/**
 * Enumerator
 * @param object Key : Value object
  */
function jEnum(object) {
    var tmp = {},
    omit = ['getKeys', 'getValues', 'prototype', 'getKey', 'hasKey', 'hasValue'];

    for (var property in object) {
        tmp[property] = object[property];
    }
    tmp.getKeys = function() {
        var tmp = [];
        for (var property in this) {
            if (omit.indexOf(property) === -1) tmp.push(property)
        }
        return tmp;
    };
    tmp.getValues = function() {
        var tmp = [];
        for (var property in this) {
            if (omit.indexOf(property) === -1) tmp.push(this[property]);
        }
        return tmp;
    };
    tmp.getKey = function(value) {
        for (var property in this) {
            if (omit.indexOf(property) === -1 && this[property] === value) return property
        }
        return null;
    };
    tmp.hasKey = function(key) {
        return this.getKeys().indexOf(key) != -1
    };
    tmp.hasValue = function(val) {
        return this.getValues().indexOf(val) != -1;
    };
    return tmp;
}
jEnum.prototype = new jClassId("jEnum");